import 'package:flutter/material.dart';

class CommonFloatingActionButton extends StatelessWidget {
  final String title;
  final Function onTop;

  const CommonFloatingActionButton({Key key, this.title, this.onTop}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
          onTap: (){
            if(onTop!=null) onTop();
          },
          child: Container(
            margin: EdgeInsets.all(20.0),
            height: 40.0,
            decoration: BoxDecoration(
              color: Colors.green,
              borderRadius: BorderRadius.circular(10.0)
            ),
            child: Center(
              child: Text(title, style: TextStyle(color: Colors.white, fontSize: 16.0, fontWeight: FontWeight.w500),),
            ),
          ),
        );
  }
}